package com.up2566.demo.controller;

import com.up2566.demo.model.dto.ComputeDto;
import com.up2566.demo.model.vo.ComputeVo;
import com.up2566.demo.service.ComputeService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 木桩计算controller
 *
 * @author up
 * @date 2021/1/11
 */
@RestController
@RequestMapping("/")
public class DemoController {

    private final ComputeService computeDemo;

    public DemoController(ComputeService computeDemo) {
        this.computeDemo = computeDemo;
    }

    @RequestMapping(value = "/compute")
    public ComputeVo compute(@RequestBody ComputeDto dto) {
        return computeDemo.compute(dto);
    }

}
